package homework0822;

import java.util.List;

public class Books {
    Integer id;
    Double price;
    Integer type;
    String autor;

    public static final Boolean ifflag(List<Books> book1, Books book2) {
        for (Books b : book1
        ) {
            if (b.getId().equals(book2.getId()) &&
                    b.getAutor().equals(book2.getAutor()) &&
                    b.getPrice().equals(book2.getPrice()) &&
                    b.getType().equals(book2.getType())) {
                System.out.println("*****************");
                return true;
            }


        }
        return false;
    }

    public Books(Integer id, Double price, Integer type, String autor) {
        this.id = id;
        this.price = price;
        this.type = type;
        this.autor = autor;
    }

    public Books() {
    }

    @Override
    public String toString() {
        return "Books{" +
                "id=" + id +
                ", price=" + price +
                ", type=" + type +
                ", autor='" + autor + '\'' +
                '}';
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getAutor() {
        return autor;
    }

    public void setAutor(String autor) {
        this.autor = autor;
    }
}
